import { nanoid } from 'nanoid'
import { add_reducers } from '../common'

const initData = [{ id: nanoid(), name:'扎三年', age:18 }]
export default  function Count_reducer(preState = initData, action) {
    const { type, data } = action  
    switch (type) {
        case add_reducers:  
            return [...preState, data]
        default:
            return preState
    }
}